package com.hongyi.modelcontest.core.util;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class ScheduledService {
    private static final Logger logger = LoggerFactory.getLogger(ScheduledService.class);
    //@Resource
    //private RecordService recordService;

    /**
     * 自动取消订单
     */
    @Scheduled(cron = "0 0/5 * * * ?")
    public void cancelOrder() {
        try {
            //recordService.autoCancel();
        } catch (Exception e) {
            logger.error("定时取消任务{}", e);
        }
    }

}